home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_weap_imp1.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
5KB
|
220 lines
# Jones 3D Cog Script
#
# weap_IMP1.cog
#
# [RT]
#
# Controls Infernal Machine Part #1, the Rumbler.
#
# (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ===================================================================
symbols
message startup
message fire
message activated
message deactivated
message selected
message deselected
message callback
message timer
message changed
message user0
model impOn=imp1_vibrat_on.3do local # Autoloaded
model impOff=imp1_vibrat.3do local # Autoloaded
sound pull=gen_grenade_pull.wav local # Autoloaded
sound put=gen_grenade_put.wav local # Autoloaded
sound pow=imp1_chargeup.wav local # Autoloaded
sound on=imp1_powerup.wav local # Autoloaded
sound off=imp1_powerdown.wav local # Autoloaded
sound loop=imp1_on_loop.wav local # Autoloaded
template prjctle_long=+imp1_long local # Autoloaded
template projectile=+imp1 local # Autoloaded
template imp1_Fire=+imp1_fire local # Autoloaded
template imp1_Glow=+imp1_glow local # Autoloaded
thing player local
thing bullet local
thing glow local
int n_bulletSize local
int weaponNum=14 local
int handMesh local
int handNode local
int callNum local
int curSound local
int index local
int bDisabled=0 local
vector firePos local
vector dustPos local
end
# ===================================================================
code
startup:
player = GetLocalPlayerThing();
handMesh = GetMeshByName(player, "inrhand");
handNode = GetNodeByName(player, "inrhand");
n_bulletSize = 0;
return;
# -------------------------------------------------------------------
fire:
if (bDisabled)
{
bDisabled = 0;
return;
}
SetThingMesh(player, handMesh, impOn, 0);
firePos = GetThingJointPos(player, handNode);
if ( n_bulletSize == 0 )
{
bullet = FireProjectile(player, projectile, pow, -1, firePos, '0 0 0', 1.0, 0x0, 0.0, 0.0);
}
else
{
bullet = FireProjectile(player, prjctle_long, pow, -1, firePos, '0 0 0', 1.0, 0x0, 0.0, 0.0);
}
if (bullet != -1)
{
CreateThing(imp1_Fire, bullet);
}
dustPos = GetThingJointPos(player, handNode);
dustPos = VectorAdd(dustPos, '0 0 0.035');
for(index = 0; index < 5; index = index + 1)
{
MakeFairyDust(player, dustPos);
}
IMPStartFiring(14);
SetFireWait(player, 1.5);
SetTimer(0.3);
return;
# -------------------------------------------------------------------
activated:
ActivateWeapon(player, 0.01);
return;
# -------------------------------------------------------------------
deactivated:
DeactivateWeapon(player);
return;
# -------------------------------------------------------------------
selected:
SetAimWait(player, 0.0);
SetMountWait(player, 0.7);
SetArmedMode(player, 5);
SetCurWeapon(player, weaponNum);
SetThingFireOffset(player, '0.0 0.0 0.03');
CaptureThing(player);
PlayMode(player, 66, 0);
return;
# -------------------------------------------------------------------
deselected:
SetMountWait(player, 1.0);
StopMode(player, 66, 0);
CaptureThing(player);
PlayMode(player, 67, 0);
SetArmedMode(player, 0);
StopSound(curSound, 0.0);
PlaySoundThing(off, player, 1, -1, -1, 0x880);
return;
# -------------------------------------------------------------------
callback:
callNum = GetParam(1);
ReleaseThing(player);
if (callNum == 28)
{
# Model swaps & FX
SetWeaponModel(player, weaponNum);
glow = AttachThingToThingMesh(player, imp1_Glow, handMesh);
# Sounds
PlaySoundThing(pull, player, 1, -1, -1, 0x880);
PlaySoundThing(on, player, 1, -1, -1, 0x880);
Sleep(0.5);
curSound = PlaySoundThing(loop, player, 1, -1, -1, 0x881);
}
else if (callNum == 29)
{
# Cleanup...
ResetWeaponModel(player);
DetachThingMesh(glow);
PlaySoundThing(put, player, 1, -1, -1, 0x880);
}
return;
# -------------------------------------------------------------------
timer:
SetThingMesh(player, handMesh, impOff, 0);
IMPEndFiring(14);
return;
# -------------------------------------------------------------------
changed:
# This message is called when an IMP is activated on an IMP stand
bDisabled = 1;
return;
# -------------------------------------------------------------------
user0:
# This message sent to select a range for IMP1 projectiles
# DEBUGFLEX(n_bulletSize, "IMP1 projectile size set to");
n_bulletSize = GetParam(0);
return;
end